import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Agua here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Agua extends Actor
{
    /**
     * Act - do whatever the Agua wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private GreenfootImage agua1 = new GreenfootImage("Agua1.png");
    private GreenfootImage agua2 = new GreenfootImage("Agua2.png");
    public int num;
    
    public void act() 
    {
       Actor aux=getOneIntersectingObject(Stickman.class);  
       if(aux!=null){ World aux1=getWorld(); ((StickmanWorld)aux1).aumentaO(1);}
       num++;
       if(num==20){setImage(agua2);}
       if(num==40){setImage(agua1);num=0;}
    } 
    public Agua(){num=0;setImage(agua1);}
    
}
